<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>

</head>

<body>
    <div id="ysh">
        <img :src="src" alt="" style="height: 300px;width: 300px;">
        <button @click="handle">切换</button>
    </div>
    
</body>
<script>
    var vm = new Vue({
        el: "#ysh",
        data: {
            flag: true,
            src: '../1/123.webp'
        },
        methods: {
            handle() {
                if (this.flag == true) {
                    this.src = '../1/1.webp'
                }
                else if (this.flag == false) {
                    this.src = '../1/123.webp'
                }
                this.flag = !this.flag
            }
        }
    })
</script>

</html>